#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>

int main1()
{
	//output
	int s = 0;
	int v = 0;
	//calculation
	float t = 0;//total time
	int h = 0;  //the number of hours spent
	int min = 0;//the number of minutes spent
	//input
	int HourOfDeparture = 0;
	int MinuteOfDeparture = 0;
	
	scanf("%d %d", &s, &v);

	t = (float)s / v;
	h = (int)t / 60;
	min = (int)t - 60 * h;
	if ((float)min < (t - 60 * h))
	{
		min++;
	}

	if (7 - h < 0)
	{
		HourOfDeparture = 7 - h + 24;
	}
	else
	{
		HourOfDeparture = 7 - h;
	}
	if (min + 10 > 60)
	{
		HourOfDeparture--;
		MinuteOfDeparture = 60 + 60 - min - 10;
	}
	else
	{
		MinuteOfDeparture = 60 - min - 10;
	}

	printf("%02d:%02d", HourOfDeparture, MinuteOfDeparture);

	return 0;
}
/*
********
************
####....#.
#..###.....##....
###.......######              ###            ###
...........               #...#          #...#
## * #######                 #.#.#          #.#.#
#### * ******######             #.#.#          #.#.#
...# * **.* * **.*###....          #...#          #...#
....* * ********##.....           ###            ###
....*********....
####        ####
######        ######
##############################################################
#...#......#.##...#......#.##...#......#.##------------------#
###########################################------------------#
#..#....#....##..#....#....##..#....#....#####################
##########################################    #----------#
#.....#......##.....#......##.....#......#    #----------#
##########################################    #----------#
#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#
##########################################    ############
*/
